package com.example.sql;

import org.apache.spark.SparkConf;
import org.apache.spark.SparkContext;
import org.apache.spark.api.java.JavaRDD;
import org.apache.spark.api.java.JavaSparkContext;

/**
 * @author wangjinlong
 * @version 1.0
 * @date 2021/5/20 8:44
 */
public class RddDemo {
    static JavaSparkContext jsc;
    static {
        SparkConf conf = new SparkConf().setMaster("local").setAppName("rdd-demo");
        conf.set("spark.serializer", "org.apache.spark.serializer.KryoSerializer");
        jsc = new JavaSparkContext(conf);
    }

    public static void main(String[] args) {
        test();
    }

    public static void test(){
        JavaRDD<String> textFile = jsc.textFile("data/file.txt");
    }
}
